package com.longrise.android.byjk.widget.recyclerviewadapter;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by sjz on 15/4/25.
 */
public abstract class BaseRecyclerViewAdapter<VH extends BaseRecyclerViewAdapter.BaseRecyclerViewHolder> extends RecyclerView.Adapter<VH> {

    @Override
    public VH onCreateViewHolder(ViewGroup parent, int viewType) {
        return onCreateNormalItemViewHolder(parent, viewType);
    }

    @Override
    public void onBindViewHolder(VH holder, final int position) {
        onBindNormalViewHolder(holder, position);
    }

    public static class BaseRecyclerViewHolder extends RecyclerView.ViewHolder {

        public BaseRecyclerViewHolder(View itemView) {
            super(itemView);
        }
    }

    protected abstract VH onCreateNormalItemViewHolder(ViewGroup parent, int viewType);

    protected abstract void onBindNormalViewHolder(VH holder, final int position);


}
